package com.usian.user.controller.v1;

import com.usian.apis.admin.ApUserRealnameControllerApis;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.user.dtos.AuthDto;
import com.usian.user.constant.UserConstant;
import com.usian.user.service.ApUserRealnameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
public class ApUserRealnameController implements ApUserRealnameControllerApis {

    @Autowired
    private ApUserRealnameService apUserRealnameServiceI;


    @Override
    @PostMapping("list")
    public ResponseResult loadListByStatus(@RequestBody AuthDto dto) {
        return apUserRealnameServiceI.loadListByStatus(dto);
    }

    @Override
    @PostMapping("authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return apUserRealnameServiceI.authRealName(dto, UserConstant.AUTH_PASS);
    }

    @Override
    @PostMapping("authFail")
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        return apUserRealnameServiceI.authRealName(dto, UserConstant.AUTH_FAIL);
    }
}
